package com.wardrobe.mapper.master.admin_operator_manager;

import com.wardrobe.soa.backend.operator.AdminOperatorBean;
import com.wardrobe.soa.backend.operator.PermissionBean;
import com.wardrobe.soa.backend.operator.RoleBean;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component("adminOperatorMasterMapper")
public interface AdminOperatorMasterMapper {
    int addOperator(AdminOperatorBean bean);

    int delOperator(@Param("operatorId") int operatorId);

    int updateOperator(AdminOperatorBean bean);

    int resetPwd(AdminOperatorBean bean);

    int addRole(RoleBean bean);

    int updateRole(RoleBean bean);

    int delRole(RoleBean bean);


    int addPermission(PermissionBean bean);

    int updatePermission(PermissionBean bean);

    int delPermission(PermissionBean bean);

    int removePermissionFromRole(RoleBean bean);

    int addPermissionFromRole(@Param("roleId") int roleId, @Param("permissionId") int permissionId);

    int removeRoleFromOperator(AdminOperatorBean bean);

    int addRoleFromOperator(@Param("operatorId") int operatorId, @Param("roleId") int roleId);

    int addRoleFromOperatorBatch(@Param("operatorId") int operatorId, @Param("roleList") List roleIds);

    int addaddPermissionFromRoleBatch(@Param("roleId") int operatorId, @Param("permissionList") List roleIds);
}
